package com.rk.pethome.user.mapper;
import com.rk.pethome.user.domain.User;
import com.rk.pethome.user.domain.WechatUser;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

@Repository
public interface WechatUserMapper {

    /**
     * 通过openid查询微信用户
     *
     * @param openid
     * @return
     */
    WechatUser loadByOpenid(String openid);


    /**
     * 保存微信用户
     *
     * @param wechatUser
     */
    void saveUser(WechatUser wechatUser);


    /**
     * 绑定微信号
     * @param u 用户对象
     * @param openid    微信的唯一标志
     */
    void updateByOpenid(@Param("u")User u,@Param("openid") String openid);
}
